/*******************************************OVERVIEW****************************************************************
 
"Reassessing the Link between Revolutionary Threats and Democratization" 
 
Replication File
 
Figure 2
 
  
********************************************************************************************************************/

clear
set more off
#delimit ;


/*Set Directory -- You will need to adjust this line of code accordingly */; 

cd "/Users/YourFiles/Replication/";

/*Create Log File*/;

log using "Figure 2", replace text;



/*Load Data File - You will need to download AF's replicaton files*/;

/* https://www.econometricsociety.org/publications/econometrica/browse/2015/03/01/democratization-under-threat-revolution-evidence-great-reform */;

/*Please use the data file data_const.dta*/;

use "/Users/YourFiles/11484_Data_and_Programs/data/data_const.dta";


locmtest share1831 (constriots10 = road);


matrix A = (1\ 2\ 3	\ 4	\ 5	\ 6	\7	\8	\9	\10	\11	\12	\13	\14	\15	\16	\17	\19	\20	\21	\22	\23	\24	\27	\28	\29	\33	\34	\35	\37	\39	\50	\54	\64	\67	\71);

putexcel set "matrices.xlsx", replace;


putexcel A1 = matrix(A);


putexcel B1 = matrix(e(Wols));


putexcel C1 = matrix(e(W));

import excel "matrices.xlsx", sheet("Sheet1") clear;

rename A riots;

rename B ols; 

rename C iv;

twoway line ols riots if riots<70 || line iv riots if riots<70;



log c;
